package com.kedacom.ctsp.authority.vo;


import com.kedacom.ctsp.authority.dto.DataAccessDTO;
import com.kedacom.ctsp.authority.dto.FieldDTO;
import com.kedacom.ctsp.authority.entity.ExtendedBean;
import com.kedacom.ctsp.authority.entity.Resource;
import com.kedacom.ctsp.web.entity.TreeSupportBean;
import com.kedacom.ctsp.web.vo.CrudVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 资源vo
 *
 * @author sunchenjie
 * @date 2017/11/12
 */
public interface ResourceVO extends CrudVO<Resource, String>, TreeSupportBean<ResourceVO, String>, ExtendedBean {

    /**
     * 资源名称
     */
    String NAME = "name";
    /**
     * 唯一标识（在系统中使用）
     */
    String SIGN = "sign";
    /**
     * 类型 10 菜单 20 操作 30 权限等
     */
    String TYPE = "type";
    /**
     * 备注
     */
    String DESCRIPTION = "description";
    /**
     * 数据
     */
    String DATA = "data";
    /**
     * 对应的url
     */
    String URL = "url";


    String getName();

    void setName(String name);

    String getDescription();

    void setDescription(String description);

    String getData();

    void setData(String data);

    String getUrl();

    void setUrl(String url);

    List<FieldDTO> getField();

    void setField(List<FieldDTO> field);

    List<DataAccessDTO> getDataAccess();

    void setDataAccess(List<DataAccessDTO> dataAccess);

    String getDataScope();

    void setDataScope(String dataScope);

    Boolean getChecked();

    void setChecked(Boolean checked);

    default Boolean getHasChildren() {
        return CollectionUtils.isNotEmpty(getChildren());
    }

    RequestMethod getMethod();

    void setMethod(RequestMethod requestMethod);


}
